#version 310 es
#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#endif

precision highp float;
precision highp int;
#define HLSLCC_ENABLE_UNIFORM_BUFFERS 1
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
#define UNITY_UNIFORM
#else
#define UNITY_UNIFORM uniform
#endif
#define UNITY_SUPPORTS_UNIFORM_LOCATION 1
#if UNITY_SUPPORTS_UNIFORM_LOCATION
#define UNITY_LOCATION(x) layout(location = x)
#define UNITY_BINDING(x) layout(binding = x, std140)
#else
#define UNITY_LOCATION(x)
#define UNITY_BINDING(x) layout(std140)
#endif
uniform 	vec4 _ScaledScreenParams;
uniform 	vec2 _GlobalMipBias;
uniform 	vec4 _MainLightPosition;
uniform 	mediump vec4 _MainLightColor;
uniform 	mediump vec4 _AmbientOcclusionParam;
uniform 	vec3 _WorldSpaceCameraPos;
uniform 	vec4 _MainLightShadowParams;
uniform 	vec4 hlslcc_mtx4x4_MainLightWorldToLight[4];
uniform 	float _MainLightCookieTextureFormat;
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
UNITY_BINDING(0) uniform UnityPerDraw {
#endif
	UNITY_UNIFORM vec4                hlslcc_mtx4x4unity_ObjectToWorld[4];
	UNITY_UNIFORM vec4                hlslcc_mtx4x4unity_WorldToObject[4];
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_LODFade;
	UNITY_UNIFORM mediump vec4 Xhlslcc_UnusedXunity_WorldTransformParams;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_RenderingLayer;
	UNITY_UNIFORM mediump vec4                unity_LightData;
	UNITY_UNIFORM mediump vec4 Xhlslcc_UnusedXunity_LightIndices[2];
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_ProbesOcclusion;
	UNITY_UNIFORM mediump vec4 Xhlslcc_UnusedXunity_SpecCube0_HDR;
	UNITY_UNIFORM mediump vec4 Xhlslcc_UnusedXunity_SpecCube1_HDR;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_SpecCube0_BoxMax;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_SpecCube0_BoxMin;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_SpecCube0_ProbePosition;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_SpecCube1_BoxMax;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_SpecCube1_BoxMin;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_SpecCube1_ProbePosition;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_LightmapST;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_DynamicLightmapST;
	UNITY_UNIFORM mediump vec4                unity_SHAr;
	UNITY_UNIFORM mediump vec4                unity_SHAg;
	UNITY_UNIFORM mediump vec4                unity_SHAb;
	UNITY_UNIFORM mediump vec4                unity_SHBr;
	UNITY_UNIFORM mediump vec4                unity_SHBg;
	UNITY_UNIFORM mediump vec4                unity_SHBb;
	UNITY_UNIFORM mediump vec4                unity_SHC;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_RendererBounds_Min;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_RendererBounds_Max;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXhlslcc_mtx4x4unity_MatrixPreviousM[4];
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXhlslcc_mtx4x4unity_MatrixPreviousMI[4];
	UNITY_UNIFORM vec4 Xhlslcc_UnusedXunity_MotionVectorsParams;
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
};
#endif
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
UNITY_BINDING(1) uniform UnityPerMaterial {
#endif
	UNITY_UNIFORM vec4 Xhlslcc_UnusedX_SoftParticleFadeParams;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedX_CameraFadeParams;
	UNITY_UNIFORM vec4 Xhlslcc_UnusedX_BaseMap_ST;
	UNITY_UNIFORM mediump vec4                _BaseColor;
	UNITY_UNIFORM mediump vec4 Xhlslcc_UnusedX_EmissionColor;
	UNITY_UNIFORM mediump vec4 Xhlslcc_UnusedX_BaseColorAddSubDiff;
	UNITY_UNIFORM mediump vec4 Xhlslcc_UnusedX_SpecColor;
	UNITY_UNIFORM mediump float Xhlslcc_UnusedX_Cutoff;
	UNITY_UNIFORM mediump float Xhlslcc_UnusedX_Smoothness;
	UNITY_UNIFORM mediump float Xhlslcc_UnusedX_DistortionStrengthScaled;
	UNITY_UNIFORM mediump float Xhlslcc_UnusedX_DistortionBlend;
	UNITY_UNIFORM mediump float                _Surface;
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
};
#endif
UNITY_LOCATION(0) uniform mediump sampler2D _ScreenSpaceOcclusionTexture;
UNITY_LOCATION(1) uniform mediump sampler2D _MainLightShadowmapTexture;
UNITY_LOCATION(2) uniform mediump sampler2DShadow hlslcc_zcmp_MainLightShadowmapTexture;
UNITY_LOCATION(3) uniform mediump sampler2D _MainLightCookieTexture;
UNITY_LOCATION(4) uniform mediump sampler2D _BaseMap;
in highp vec2 vs_TEXCOORD0;
in mediump vec4 vs_COLOR0;
in highp vec4 vs_TEXCOORD1;
in mediump vec3 vs_TEXCOORD2;
in highp vec4 vs_TEXCOORD7;
layout(location = 0) out mediump vec4 SV_Target0;
mediump vec4 u_xlat16_0;
vec4 u_xlat1;
bool u_xlatb1;
mediump vec3 u_xlat16_2;
mediump vec4 u_xlat16_3;
mediump vec4 u_xlat16_4;
vec3 u_xlat5;
mediump vec3 u_xlat16_9;
vec3 u_xlat11;
bvec2 u_xlatb11;
float u_xlat19;
mediump float u_xlat16_19;
bool u_xlatb19;
mediump float u_xlat16_20;
void main()
{
vec4 hlslcc_FragCoord = vec4(gl_FragCoord.xyz, 1.0/gl_FragCoord.w);
    u_xlat16_0 = texture(_BaseMap, vs_TEXCOORD0.xy, _GlobalMipBias.x);
    u_xlat16_0 = u_xlat16_0 * _BaseColor;
    u_xlat16_0 = u_xlat16_0 * vs_COLOR0;
    u_xlat1.x = dot(vs_TEXCOORD2.xyz, vs_TEXCOORD2.xyz);
    u_xlat1.x = inversesqrt(u_xlat1.x);
    u_xlat1.xyz = u_xlat1.xxx * vs_TEXCOORD2.xyz;
    u_xlat1.w = 1.0;
    u_xlat16_2.x = dot(unity_SHAr, u_xlat1);
    u_xlat16_2.y = dot(unity_SHAg, u_xlat1);
    u_xlat16_2.z = dot(unity_SHAb, u_xlat1);
    u_xlat16_3 = u_xlat1.yzzx * u_xlat1.xyzz;
    u_xlat16_4.x = dot(unity_SHBr, u_xlat16_3);
    u_xlat16_4.y = dot(unity_SHBg, u_xlat16_3);
    u_xlat16_4.z = dot(unity_SHBb, u_xlat16_3);
    u_xlat16_20 = u_xlat1.y * u_xlat1.y;
    u_xlat16_20 = u_xlat1.x * u_xlat1.x + (-u_xlat16_20);
    u_xlat16_3.xyz = unity_SHC.xyz * vec3(u_xlat16_20) + u_xlat16_4.xyz;
    u_xlat16_2.xyz = u_xlat16_2.xyz + u_xlat16_3.xyz;
    u_xlat16_2.xyz = max(u_xlat16_2.xyz, vec3(0.0, 0.0, 0.0));
    u_xlat5.xy = vec2(1.0) / vec2(_ScaledScreenParams.xy);
    u_xlat5.xy = u_xlat5.xy * hlslcc_FragCoord.xy;
    u_xlat16_19 = texture(_ScreenSpaceOcclusionTexture, u_xlat5.xy, _GlobalMipBias.x).x;
    u_xlat5.x = u_xlat16_19 + -1.0;
    u_xlat5.x = _AmbientOcclusionParam.w * u_xlat5.x + 1.0;
    u_xlat16_20 = min(u_xlat16_19, 1.0);
    vec3 txVec0 = vec3(vs_TEXCOORD7.xy,vs_TEXCOORD7.z);
    u_xlat16_19 = textureLod(hlslcc_zcmp_MainLightShadowmapTexture, txVec0, 0.0);
    u_xlat16_3.x = (-_MainLightShadowParams.x) + 1.0;
    u_xlat16_3.x = u_xlat16_19 * _MainLightShadowParams.x + u_xlat16_3.x;
    u_xlatb19 = 0.0>=vs_TEXCOORD7.z;
    u_xlatb11.x = vs_TEXCOORD7.z>=1.0;
    u_xlatb19 = u_xlatb19 || u_xlatb11.x;
    u_xlat16_3.x = (u_xlatb19) ? 1.0 : u_xlat16_3.x;
    u_xlat11.xyz = vs_TEXCOORD1.xyz + (-_WorldSpaceCameraPos.xyz);
    u_xlat19 = dot(u_xlat11.xyz, u_xlat11.xyz);
    u_xlat19 = u_xlat19 * _MainLightShadowParams.z + _MainLightShadowParams.w;
    u_xlat19 = clamp(u_xlat19, 0.0, 1.0);
    u_xlat16_9.x = (-u_xlat16_3.x) + 1.0;
    u_xlat16_3.x = u_xlat19 * u_xlat16_9.x + u_xlat16_3.x;
    u_xlatb19 = _MainLightCookieTextureFormat!=-1.0;
    if(u_xlatb19){
        u_xlat11.xy = vs_TEXCOORD1.yy * hlslcc_mtx4x4_MainLightWorldToLight[1].xy;
        u_xlat11.xy = hlslcc_mtx4x4_MainLightWorldToLight[0].xy * vs_TEXCOORD1.xx + u_xlat11.xy;
        u_xlat11.xy = hlslcc_mtx4x4_MainLightWorldToLight[2].xy * vs_TEXCOORD1.zz + u_xlat11.xy;
        u_xlat11.xy = u_xlat11.xy + hlslcc_mtx4x4_MainLightWorldToLight[3].xy;
        u_xlat11.xy = u_xlat11.xy * vec2(0.5, 0.5) + vec2(0.5, 0.5);
        u_xlat16_4 = texture(_MainLightCookieTexture, u_xlat11.xy, _GlobalMipBias.x);
        u_xlatb11.xy = equal(vec4(vec4(_MainLightCookieTextureFormat, _MainLightCookieTextureFormat, _MainLightCookieTextureFormat, _MainLightCookieTextureFormat)), vec4(0.0, 1.0, 0.0, 0.0)).xy;
        u_xlat16_9.x = (u_xlatb11.y) ? u_xlat16_4.w : u_xlat16_4.x;
        u_xlat16_9.xyz = (u_xlatb11.x) ? u_xlat16_4.xyz : u_xlat16_9.xxx;
    } else {
        u_xlat16_9.x = float(1.0);
        u_xlat16_9.y = float(1.0);
        u_xlat16_9.z = float(1.0);
    }
    u_xlat16_9.xyz = u_xlat16_9.xyz * _MainLightColor.xyz;
    u_xlat16_9.xyz = u_xlat5.xxx * u_xlat16_9.xyz;
    u_xlat16_2.xyz = vec3(u_xlat16_20) * u_xlat16_2.xyz;
    u_xlat19 = u_xlat16_3.x * unity_LightData.z;
    u_xlat5.xyz = vec3(u_xlat19) * u_xlat16_9.xyz;
    u_xlat16_20 = dot(u_xlat1.xyz, _MainLightPosition.xyz);
    u_xlat16_20 = clamp(u_xlat16_20, 0.0, 1.0);
    u_xlat16_3.xyz = vec3(u_xlat16_20) * u_xlat5.xyz;
    u_xlat16_3.xyz = u_xlat16_0.xyz * u_xlat16_3.xyz;
    SV_Target0.xyz = u_xlat16_2.xyz * u_xlat16_0.xyz + u_xlat16_3.xyz;
    u_xlatb1 = _Surface==1.0;
    SV_Target0.w = (u_xlatb1) ? u_xlat16_0.w : 1.0;
    return;
}


// Keywords: _ADDITIONAL_LIGHT_SHADOWS _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS _SCREEN_SPACE_OCCLUSION
// 